SHELL = /bin/bash

# 项目名称

PROJECT_NAME = ant_server_api
# 重建数据表迁移(需清空数据库中 alembic_version)
db_init_migrate:
	rm -rf ./migrations/versions/*  && flask db migrate

# 执行数据迁移
db_migrate:
	flask db migrate

# 执行数据迁移
db_upgrade:
	flask db upgrade

# 执行数据迁移并同步(慎用)
db_migrate_upgrade:
	flask db migrate && flask db upgrade


# 初始化或更新用户数据
init_admin:
	flask init_admin

# 初始化或更新权限数据
init_permissions:
	flask init_permissions

# 初始化或更新数据字典
init_data:
	flask init_data


# 构建镜像
build_image: 
	docker-compose build ${PROJECT_NAME}

# 推送镜像
push_image:
	docker-compose pull ${PROJECT_NAME}

# 拉取镜像
pull_image:
	docker-compose pull ${PROJECT_NAME}